home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / recode.lha / recode-3.2.4 / asciltex.l < prev    next >
Text File  |  1992-08-26  |  2KB  |  63 lines

  1. %{
  2. /* Conversion of files between different charsets and usages.
  3.    Copyright (C) 1990 Free Software Foundation, Inc.
  4.    Francois Pinard <pinard@iro.umontreal.ca>, 1988.
  5.  
  6.    This program is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 2, or (at your option)
  9.    any later version.
  10.  
  11.    This program is distributed in the hope that it will be useful, but
  12.    WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.    General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with this program; if not, write to the Free Software
  18.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20.  
  21. #define STEP    ascii_latex
  22.  
  23. extern int diacritics_only;
  24.  
  25. %}
  26.  
  27. %%
  28. #            { if (!diacritics_only) output ('\\'); output ('#'); }
  29. \$            { if (!diacritics_only) output ('\\'); output ('$'); }
  30. %            { if (!diacritics_only) output ('\\'); output ('%'); }
  31. &            { if (!diacritics_only) output ('\\'); output ('&'); }
  32. _            { if (!diacritics_only) output ('\\'); output ('_'); }
  33. \{            { if (!diacritics_only) output ('\\'); output ('{'); }
  34. \}            { if (!diacritics_only) output ('\\'); output ('}'); }
  35.  
  36. \\            { const char *cursor;
  37.  
  38.               if (diacritics_only)
  39.                 output ('\\');
  40.               else
  41.                 for (cursor = "\\backslash{}"; *cursor; cursor++)
  42.                   output (*cursor);
  43.             }
  44.  
  45. \"\b\<|\<\b\"        { output ('`'); output ('`'); }
  46. \"\b\>|\>\b\"        { output ('\''); output ('\''); }
  47.  
  48. '\b[Ee]            { output ('\\'); output ('\''); output (yytext[2]); }
  49. [Ee]\b'            { output ('\\'); output ('\''); output (yytext[0]); }
  50.  
  51. [`^"]\b[AaEeIOoUu]    { output ('\\'); output (yytext[0]);
  52.               output (yytext[2]); }
  53. [`^"]\bi        { output ('\\'); output (yytext[0]); output ('\\');
  54.               output ('i'); output (' '); }
  55. [AaEeIOoUu]\b[`^"]    { output ('\\'); output (yytext[2]);
  56.               output (yytext[0]); }
  57. i\b[`^"]        { output ('\\'); output (yytext[2]); output ('\\');
  58.               output ('i'); output (' '); }
  59. \,\b[Cc]        { output ('\\'); output ('c'); output ('{');
  60.               output (yytext[2]); output ('}'); }
  61. [Cc]\b\,        { output ('\\'); output ('c'); output ('{');
  62.               output (yytext[0]); output ('}'); }
  63.